<!--
 * @Author: Islands 1430536748@qq.com
 * @Date: 2024-07-15 22:22:36
 * @LastEditors: 周洋 1430536748@qq.com
 * @LastEditTime: 2024-08-16 15:03:08
 * @version: 1.2.0
 * @Description: 图标组件 (目前支持 element/阿里图标库/字节)
-->
<script setup lang="ts">
import { props } from '../props';
const { size, icon } = defineProps(props)
</script>
<template>
    <template v-if="typeof icon === 'string'">
        <!-- #icon-xxx -->
        <svg v-if="icon.startsWith('#')" :width="size" :height="size" aria-hidden="true">
            <use :xlink:href="icon" :style="{ width: size, height: size }" />
        </svg>
        <!-- icon-xxx -->
        <i v-else :class="`iconfont ` + icon" :style="{ fontSize: size }" />
    </template>
    <!-- 组件 -->
    <component v-else :is="icon" :style="{ width: size, height: size }" />
</template>